<template>
  <p>
    <el-button type="primary" @click="login">登录</el-button>
  </p>

</template>

<script>
import {user} from '@api/index'
export default {
  name: 'login',
  created () {

  },
  methods: {
    login () {
      let params = {
        'sn': '09089 ',
        'name': '李粤',
        'jobList': [ { 'id': 2, 'name': 'admin', 'valid': 1 }, { 'id': 10, 'name': 'admin', 'valid': 1 } ],
        'roleList': [ {
          'id': 10,
          'name': 'admin',
          'description': null,
          'enabled': true,
          'isInit': null,
          'creator': null,
          'createTime': null,
          'modifier': null,
          'modifyTime': null,
          'version': 0,
          'deleted': null
        } ]
      }

      user()._login(params).then(res => {
        if (res.status) {
          this.$router.push({name: 'main'})
        }
      })
    }
  }
}
</script>

<style scoped>
</style>
